package com.dubito.encrypt.base64;

import java.io.UnsupportedEncodingException;
import java.util.Base64;

/**
 * @author liliang
 * @description:
 * @date 2018/5/17.
 */
public class SecBase64 {

    public static void main(String[] args) throws UnsupportedEncodingException {
        String original = "Hello\u00ff 编码测试";
        String b64 = Base64.getEncoder().withoutPadding().encodeToString(original.getBytes());
        System.out.println(b64);
        String ori = new String(Base64.getDecoder().decode(b64),"UTF-8");
        System.out.println(ori);
        System.out.println("----------------");
    }

}
